package com.boot.webflux.security.example2.module.dao;


import com.boot.webflux.security.example2.module.entity.SysRole;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

import java.util.List;

@Repository
public interface SysRoleRepository extends ReactiveCrudRepository<SysRole, Long> {

    @Query(value = "select role.* from sys_role role ,sys_role_resource rr where role.role_id =rr.role_id and  rr.resource_id =1")
    public Flux<SysRole> findByResourceId(Long resourceId);

}
